<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
    <head>
        <title> Formulario Libro </title>  
        <script type="text/javascript">
            function validacion() {
                var isbn = document.getElementById("isbn");
                var miform = document.getElementById("miform");
                if (isbn.value === "") {
                    alert("Datos ISBN No Validos!");
                    return false;
                } else {
                    miform.submit();
                }
            }
        </script>
        <style type="text/css">
            body, form{
                text-align: center;
            }
            legend, label{
                font-weight: bold;
            }
            input,p, submitBtn{
                text-align: center;
            }
           
        </style>
    </head>
    <body>
            <form action="insertarLibro.jsp" id="miform" onsubmit="validacion()"> 
                <fieldset>
                    <legend> Formulario Alta Libro </legend>
                    <p><label for="isbn">ISBN:</label>
                        <input type="text" name="isbn" id="isbn"/>
                    </p>
                    <p><label for="titulo">Titulo:</label>   
                        <input type="text" name="titulo" id="titulo"/>
                    </p>
                    <p><label for="categoria">Categoria:</label> 
                        <input type="text" name="categoria" id="categoria"/>
                    </p>

                    <input id="submitBtn" type="submit" value="Insertar"/>
                </fieldset>
            </form>
    </body>
</html>
